package lab02.test21;

/**
 * Created by Administrator on 2017/10/30.
 */
public class CharCounter {public static int counter(String s,char c){
    int count=0;
    for(int i=0;i<s.length();i++){
        if(s.charAt(i)==c){
            count++;
        }
    }
    return count;
}
    public static void main(String args[]){
        System.out.println(new CharCounter().counter("LOVELOVEYOU",'O'));
    }
}

